from django.contrib import admin
from django.urls import path, include, re_path
from django.conf import settings
from django.conf.urls.static import static
from rest_framework import routers

from main import views


urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/v1/news/', views.NewsAPIAll.as_view()),
    path('api/v1/news/update/<int:pk>/', views.NewAPIUpdate.as_view()),
    path('api/v1/news_delete/<int:pk>/', views.NewsAPIDestroy.as_view()),
    path('api/v1/drf-auth/', include('rest_framework.urls')),
    path('api/v1/auth/', include('djoser.urls')),
    re_path(r'^auth/', include('djoser.urls.authtoken')),
]


#if settings.DEBUG:
#    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
